package com.mobi.Survey.uicomponents;

import android.content.Context;
import android.graphics.Color;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mobi.Survey.controller.SurveyDetailPojo;

/**
 * 
 * <p>
 * <b>Author:</b> Yahya Arshad
 * <p>
 * <b>Company:</b> Mobi Media Soft
 * <p>
 * <b> Website:</b> www.mobimediasoft.com
 * <p>
 * CustomTextView.java
 * 
 * 
 */
public class CustomTextView extends TextView
{
	public static final String DELIM = "|";
	private LinearLayout ll;

	public CustomTextView(Context context)
	{
		super(context);

	}

	public CustomTextView(Context ctx, String op)
	{
		super(ctx);
		ll = new LinearLayout(ctx);

		ll.setOrientation(LinearLayout.VERTICAL);

		ll.addView(this);
	}

	public LinearLayout getView()
	{
		return ll;

	}

	public void setCustomColor(SurveyDetailPojo sdp)
	{
		if (null != sdp && null != sdp.getSurvey()
				&& null != sdp.getSurvey().getFontColor())
		{
			String txtColor = sdp.getSurvey().getFontColor();

			this.setTextColor(Color.parseColor("#" + txtColor));
		} else
		{
			this.setTextColor(Color.WHITE);
		}
	}
}
